﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZX.TR.Bussiness;
using ZX.TR.Library;

namespace ZX.WebApp.TR
{
    public partial class QuestionnaireSubjectList : System.Web.UI.Page
    {
        /// <summary>
        /// 窗体加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                DataBinds();
            }
        }
        private void DataBinds()
        {
            BTrSubjectInfo SubjectInfo = new BTrSubjectInfo();
            string id = this.Request.QueryString["id"];
            if (id != "")
            {
                IList<V_SubjectList> List = SubjectInfo.GetSubjectListByQuestionnaireID(new Guid(id));
                if (List != null)
                {
                    this.lblMsg.Visible = false;
                    this.rpList.DataSource = List;
                    this.rpList.DataBind();
                    this.lblName.Text = List[0].QuestionnaireName;
                    this.lblSum.Text = List[0].SubjectSum.ToString();
                    this.lblQAim.Text = List[0].QAim;
                    this.lblPointSum.Text = List[0].PointSum.ToString();
                }
                else
                {
                    this.lblMsg.Visible = true;
                }
            }
        }
    }
}